(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/script/FloatPlatForm.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '2a3b1Q9SQpNdIuoH8UkhfGb', 'FloatPlatForm', __filename);
// script/FloatPlatForm.js

"use strict";

/**
 * 紫色浮台道具
 */
cc.Class({
    extends: cc.Component,

    properties: {},

    onLoad: function onLoad() {
        this.pos = this.node.getPosition();
        this.backNode = cc.find("Canvas/player");
    },


    // 只在两个碰撞体开始接触时被调用一次
    onBeginContact: function onBeginContact(contact, selfCollider, otherCollider) {
        var _this = this;

        var rigidBody = selfCollider.node.getComponent(cc.RigidBody);
        if (selfCollider.tag === cc.vv.TAG.FLOAT) {
            //将浮块的状态改为动态的，然后延时显示
            setTimeout(function () {
                rigidBody.type = 2;
                var fade = cc.fadeIn();
                selfCollider.node.runAction(fade);
            }, 500);
            //关闭接触监听器
            rigidBody.enabledContactListener = false;
            this.inof();
        }
        //块下落之后延时显示
        setTimeout(function () {
            var fade = cc.fadeIn(2);
            selfCollider.node.runAction(fade);
            _this.node.setPosition(_this.pos);
            rigidBody.type = 0;
            // rigidBody._b2Body.m_linearVelocity.y = 0;
            //启动接触监听器
            rigidBody.enabledContactListener = true;
        }, 5000);

        setTimeout(function () {
            _this.node.active = true;
        }, 5000);
    },

    inof: function inof() {
        var _this2 = this;

        setTimeout(function () {
            var add = _this2.backNode.getComponent(cc.RigidBody)._b2Body.m_linearVelocity;
            add.y = 1;
            var rigidBody = _this2.node.getComponent(cc.RigidBody);
            rigidBody._b2Body.m_linearVelocity.y = -30;
            _this2.node.active = false;
        }, 1000);
    }
}
// start () {},

//update(dt) {},
);

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=FloatPlatForm.js.map
        